package com.liruo.springframework.core.aop.aopcontext;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Slf4j
@Aspect
@Component
public class NoProxyMethodCallProxyMethodAspect {
  public static boolean INVOKE = false;
  @Before("execution(void com.liruo.springframework.core.aop.aopcontext.GetCurrentProxyTarget.proxyMethod(String))")
  public void before(JoinPoint joinPoint){
    INVOKE = true;
    log.info("{}: target={}", NoProxyMethodCallProxyMethodAspect.class.getSimpleName(), joinPoint.getTarget());
  }
}
